package com.lanou3g.springmvc.web;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class PathVarController {


    @RequestMapping("/test_path_var/get/{id}")
    public String getParamFromPath(@PathVariable("id") String id, Model model) {
        model.addAttribute("msg", "我是通过访问路径传递的参数：" + id);
        return "hello_springmvc";
    }

}
